<!--
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-05-22 15:17:12
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-05-30 23:23:51
 * @FilePath: \vue3_nuxt_demo\pages\index.vue
 * @Description: 首页
-->

<template>
  <a-layout class="home-page-container">
    <a-row class="home-header-container">
      <NavHeader />
    </a-row>

    <a-row class="home-main-container">
      <a-col :span="15" class="main-content-container">
        <NavMain />
        <NavAside />
      </a-col>
    </a-row>
  </a-layout>
</template>



<script setup>
import NavHeader from '@/components/NavHeader.vue';
import NavMain from '@/components/NavMain.vue';
import NavAside from '@/components/NavAside.vue';

import { useUserInfo } from '@/composables/state';

const router = useRouter();

// 用户信息
const userInfo = useUserInfo();



onMounted(() => {
  if (!userInfo) {
    router.push('/login');
  }
});
</script>


<style lang="less" scoped>
.home-page-container {
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;

  .home-header-container {
    width: 100%;
    height: 80px;
    border-bottom: 1px solid #F0F0F0;
    position: fixed;
    z-index: 99;
  }

  .home-main-container {
    width: 100%;
    height: calc(100vh - 80px);
    margin-top: 80px;

    .main-content-container {
      width: 100%;
      height: 100%;
      margin: auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
  }

}
</style>